﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for AudioTest and is intended
    ///to contain all AudioTest Unit Tests
    ///</summary>
    [TestClass()]
    public class AudioTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Audio Constructor
        ///</summary>
        [TestMethod()]
        public void AudioConstructorTest() {
            Audio target = new Audio();
            Assert.AreEqual("<audio></audio>", target.ToString());
        }

        /// <summary>
        ///A test for AutoPlay
        ///</summary>
        [TestMethod()]
        public void AutoPlayTest() {
            Audio target = new Audio();
            bool expected = false;
            bool actual;
            target.AutoPlay = expected;
            actual = target.AutoPlay;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Controls
        ///</summary>
        [TestMethod()]
        public void ControlsTest() {
            Audio target = new Audio();
            bool expected = false;
            bool actual;
            target.Controls = expected;
            actual = target.Controls;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Loop
        ///</summary>
        [TestMethod()]
        public void LoopTest() {
            Audio target = new Audio();
            bool expected = false;
            bool actual;
            target.Loop = expected;
            actual = target.Loop;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Muted
        ///</summary>
        [TestMethod()]
        public void MutedTest() {
            Audio target = new Audio();
            bool expected = false;
            bool actual;
            target.Muted = expected;
            actual = target.Muted;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Preload
        ///</summary>
        [TestMethod()]
        public void PreloadTest() {
            Audio target = new Audio();
            Nullable<PreloadChoices> expected = PreloadChoices.Auto;
            Nullable<PreloadChoices> actual;
            target.Preload = expected;
            actual = target.Preload;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Src
        ///</summary>
        [TestMethod()]
        public void SrcTest() {
            Audio target = new Audio();
            string expected = string.Empty;
            string actual;
            target.Src = expected;
            actual = target.Src;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Audio target = new Audio("src");
            target.AutoPlay = true;
            target.Controls = true;
            target.Loop = true;
            target.Muted = true;
            target.Preload = PreloadChoices.Auto;
            Assert.AreEqual("<audio autoplay=\"autoplay\" " +
                "controls=\"controls\" " +
                "loop=\"loop\" " +
                "muted=\"muted\" " +
                "preload=\"auto\" " +
                "src=\"src\"></audio>", target.ToString());
        }
    }
}
